package com.ghca.mystudy.provider;

import com.ghca.mystudy.service.IService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.ImportResource;

import java.io.IOException;

/**
 * Hello world!
 *
 */
@SpringBootApplication
@ImportResource("classpath:spring-config-dubbo-server.xml")
public class App
{
    public static void main( String[] args )
    {
        SpringApplication app = new SpringApplication(App.class);

        ConfigurableApplicationContext context = app.run(args);
        IService service = context.getBean(IService.class);
        System.out.println(service.doService("world"));
        try {
            System.in. read();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
